import os
from webdriver_manager.chrome import ChromeDriverManager

os.environ['WDM_LOG_LEVEL'] = '0' # disable webdriver logging

def install(local:bool=True) -> str:
    """Install ChromeDriver.

    Args:
        local: Whether to save dirver binaries to project.root/.wdm.

    Returns:
        executable_path: ChromeDriver executable file path.
    """
    if local:
        os.environ['WDM_LOCAL'] = '1' #  save dirver binaries to project.root/.wdm.
    executable_path = ChromeDriverManager().install()

    return executable_path

if __name__ == "__main__":
    print(install())

